package program03;

/**
 * @version 1.0
 * @since:
 * @ClassName:NetSetMeal
 * @author: Li Jiahui
 * @date: 2021-01-16 23:49
 * 上网套餐类 特征：上网流量、每月资费 行为：显示所有套餐信息
 *    NetTraffic为上网套餐类的实现
 */
public class NetSetMeal extends SetMeal {
    //1.自定义私有化的成员变量
    private double netType;
    //3.自定义无参和有参的构造方法
    public NetSetMeal(){ }
    public NetSetMeal(double netType, double monthFees){
        super(monthFees);
        setNetType(netType);
    }
    //2.提供公有的get和set方法
    public double getNetType() {
        return netType;
    }
    public void setNetType(double netType) {
        this.netType= netType;
    }
    //4.自定义显示所有套餐信息
    @Override
    public void show() {
        System.out.println("上网套餐信息：上网流量：" + this.netType + "MB， 每月资费：" + monthFees +"元");
    }
}
